home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 025a / crdepp.zip / CRDE.H < prev    next >
C/C++ Source or Header  |  1991-01-13  |  6KB  |  169 lines

  1. /* crde.h */
  2.  
  3. /*
  4. The C Relational Database Engine.
  5. Copyright (c) 1990, Mark Lang.
  6. All Rights Reserved.
  7. */
  8.  
  9. #ifndef __LARGE__
  10. #error Must compile in LARGE memory model to use CRDE!
  11. #endif
  12.  
  13. #ifndef __CRDE__
  14. #define __CRDE__
  15.  
  16. #ifdef  __STDC__
  17. #define tdecl(type) type
  18. #else
  19. #define tdecl(type) type cdecl
  20. #endif
  21.  
  22. /* TABLE type */
  23.  
  24. typedef void TABLE;
  25.  
  26. /* dollar type */
  27.  
  28. typedef double dollar_t;
  29.  
  30. /* table limits */
  31.  
  32. #define MAXTABLES     128
  33. #define MAXTABLENAME  64
  34. #define MAXROWSIZE    4000
  35. #define MAXCOLNAME    16
  36. #define MAXCOLSIZE    256
  37. #define MAXKEYCOLS    8
  38. #define MAXKEYSIZE    256
  39. #define MAXROWS       2147483647
  40. #define MAXCOLS       256
  41. #define MAXINDEXES    8
  42. #define MAXJOINCOLS   256
  43. #define MAXEXPR       16
  44. #define MAXCHANGES    16
  45.  
  46. /* search relops */
  47.  
  48. #define EQ  0
  49. #define LT  1
  50. #define GT  2
  51. #define LE  3
  52. #define GE  4
  53. #define NE  5
  54.  
  55. #define LTE LE
  56. #define GTE GE
  57. #define NEQ NE
  58.  
  59. /* temporary table id's */
  60.  
  61. #define TEMP    ((char *)0)
  62. #define STATIC  ((char *)1)
  63.  
  64. /* table modes */
  65.  
  66. #define T_NORMAL 0
  67. #define T_WRITEC 1
  68. #define T_TEMP   2
  69. #define T_STATIC 3
  70.  
  71. /* function prototypes */
  72.  
  73. #ifdef __cplusplus
  74. extern "C" {
  75. #endif
  76. tdecl(int)     taccess     (TABLE *t, int mode);
  77. tdecl(long)    tadd        (TABLE *t1, TABLE *t2);
  78. tdecl(int)     tall        (tdecl(int) (*func)(TABLE *));
  79. tdecl(int)     taverage    (TABLE *t, char *c, void *result);
  80. tdecl(TABLE *) tborrow     (char *name, TABLE *t);
  81. tdecl(long)    tchange     (TABLE *t, ...);
  82. tdecl(long)    tchangeif   (TABLE *t, tdecl(int) (*action)(void *), ...);
  83. tdecl(int)     tchcol      (TABLE *t, char *old, char *new);
  84. tdecl(int)     tclose      (TABLE *t);
  85. tdecl(int)     tcmpstruct  (TABLE *t1, TABLE *t2);
  86. tdecl(int)     tcols       (TABLE *t);
  87. tdecl(int)     tcolsize    (TABLE *t, char *c);
  88. tdecl(char)    tcoltype    (TABLE *t, char *c);
  89. tdecl(int)     tcommit     (TABLE *t);
  90. tdecl(TABLE *) tcopy       (char *name, TABLE *t);
  91. tdecl(int)     tcount      (TABLE *t, char *c, void *result);
  92. tdecl(TABLE *) tcreat      (char *name, char *td);
  93. tdecl(TABLE *) tcrstruct   (char *name, TABLE *t);
  94. tdecl(long)    tdelete     (TABLE *t, ...);
  95. tdecl(long)    tdeleteif   (TABLE *t, tdecl(int) (*action)(void *), ...);
  96. tdecl(TABLE *) tdiff       (char *name, TABLE *t1, TABLE *t2);
  97. tdecl(int)     tdrop       (TABLE *t);
  98. tdecl(int)     tdropindex  (TABLE *t, char *id);
  99. tdecl(int)     tempty      (TABLE *t);
  100. tdecl(int)     terase      (char *name);
  101. tdecl(long)    texportascii(TABLE *t, char *dest);
  102. tdecl(long)    texportdBASE(TABLE *t, char *dest);
  103. tdecl(int)     tflush      (TABLE *t);
  104. tdecl(long)    tget        (TABLE *t, void *buf, long n, ...);
  105. tdecl(long)    tgetif      (TABLE *t, void *buf, long n,
  106.                 tdecl(int) (*action)(void *), ...);
  107. tdecl(TABLE *) tgroup      (char *name, TABLE *t, char *id, char *td,
  108.                 tdecl(int) (*summary)(void *, void *, int));
  109. tdecl(int)     tindex      (TABLE *t, char *id);
  110. tdecl(int)     tindexes    (TABLE *t);
  111. tdecl(TABLE *) timportascii(char *name, char *td, char *source);
  112. tdecl(TABLE *) timportdBASE(char *name, char *source);
  113. tdecl(long)    tinsert     (TABLE *t, void *recs, long n);
  114. tdecl(TABLE *) tintersect  (char *name, TABLE *t1, TABLE *t2);
  115. tdecl(TABLE *) tjoin       (char *name, TABLE *t1, char *cl1, TABLE *t2,
  116.                 char *cl2, char *pl);
  117. tdecl(int)     tload       (TABLE *t, ...);
  118. tdecl(int)     tlookup     (TABLE *t, ...);
  119. tdecl(int)     tlookupif   (TABLE *t, tdecl(int) (*action)(void *), ...);
  120. tdecl(int)     tkeyed      (TABLE *t);
  121. tdecl(TABLE *) tkeys       (char *name, TABLE *t);
  122. tdecl(int)     tmark       (TABLE *t);
  123. tdecl(int)     tmax        (TABLE *t, char *c, void *result);
  124. tdecl(int)     tmin        (TABLE *t, char *c, void *result);
  125. tdecl(int)     tmode       (TABLE *t);
  126. tdecl(int)     tnormal     (TABLE *t);
  127. tdecl(TABLE *) topen       (char *name);
  128. tdecl(TABLE *) tproject    (char *name, TABLE *t, char *pl, ...);
  129. tdecl(TABLE *) tprojectif  (char *name, TABLE *t, char *pl,
  130.                 tdecl(int) (*action)(void *), ...);
  131. tdecl(int)     trelease    (TABLE *t);
  132. tdecl(int)     trename     (char *old, char *new);
  133. tdecl(TABLE *) trepair     (char *name, char *td);
  134. tdecl(long)    treplace    (TABLE *t, void *recs, long n);
  135. tdecl(TABLE *) trestruct   (char *name, TABLE *t, char *td);
  136. tdecl(int)     trollback   (TABLE *t);
  137. tdecl(long)    trows       (TABLE *t);
  138. tdecl(int)     trowsize    (TABLE *t);
  139. tdecl(long)    tscan       (TABLE *t, ...);
  140. tdecl(long)    tscanif     (TABLE *t, tdecl(int) (*action)(void *), ...);
  141. tdecl(TABLE *) tselect     (char *name, TABLE *t, ...);
  142. tdecl(TABLE *) tselectif   (char *name, TABLE *t,
  143.                 tdecl(int) (*action)(void *), ...);
  144. tdecl(TABLE *) tsort       (char *name, TABLE *t, char *id);
  145. tdecl(TABLE *) tstruct     (char *name, TABLE *t);
  146. tdecl(long)    tsubtract   (TABLE *t1, TABLE *t2);
  147. tdecl(int)     tsum        (TABLE *t, char *c, void *result);
  148. tdecl(int)     ttransact   (TABLE *t);
  149. tdecl(TABLE *) tunion      (char *name, TABLE *t1, TABLE *t2);
  150. tdecl(long)    tupdate     (TABLE *t1, TABLE *t2);
  151. tdecl(int)     tview       (TABLE *t, char *cl, char *id, int ax, int ay,
  152.                 int bx, int by, int cattr, int fattr, int battr,
  153.                 void *rec);
  154. tdecl(int)     twritec     (TABLE *t);
  155. #ifdef __cplusplus
  156. }
  157. #endif
  158.  
  159.  
  160. /* global variables */
  161.  
  162. extern tdecl(int)  terrno;            /* contains last error code        */
  163. extern tdecl(long) trowsfound;        /* rows involved in last operation */
  164.  
  165. #endif
  166.  
  167. /* end of crde.h */
  168.  
  169.